package com.lemon.smartsafety.utils.gson;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

/**
 * Created by Cooliean on 16/1/20.
 */
public abstract class GsonBase {
    /**
     * 获取泛型中的对象类型
     * @return
     */
    public Type getType() {
        Type mySuperClass = this.getClass().getGenericSuperclass();
        Type type = ((ParameterizedType)mySuperClass).getActualTypeArguments()[0];
        return type;
    }
}
